package com.xujie.sportsmeeting.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 比赛项目请求DTO
 */
@Data
@Schema(description = "比赛项目请求参数")
public class CompetitionEventDTO {

    @Schema(description = "项目ID")
    private Long id;

    @Schema(description = "项目名称", example = "男子100米")
    @NotBlank(message = "项目名称不能为空")
    private String eventName;

    @Schema(description = "项目编码", example = "M100M")
    @NotBlank(message = "项目编码不能为空")
    private String eventCode;

    @Schema(description = "项目类型", example = "1")
    @NotNull(message = "项目类型不能为空")
    private Integer eventType;

    @Schema(description = "性别限制", example = "1")
    private Integer genderLimit;

    @Schema(description = "最大参赛人数", example = "8")
    private Integer maxParticipants;

    @Schema(description = "项目描述", example = "男子100米短跑项目")
    private String description;

    @Schema(description = "比赛规则", example = "标准田径跑道，直道比赛")
    private String rules;

    @Schema(description = "计分方式", example = "按时间排名")
    private String scoringMethod;

    @Schema(description = "比赛地点", example = "田径场")
    private String venue;

    @Schema(description = "比赛时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime competitionTime;

    @Schema(description = "比赛时长(分钟)", example = "30")
    private Integer durationMinutes;

    @Schema(description = "报名开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime registrationStartTime;

    @Schema(description = "报名结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime registrationEndTime;

    @Schema(description = "状态", example = "1")
    private Integer status;
}
